home *** CD-ROM | disk | FTP | other *** search
- package javax.swing;
-
- import java.awt.Component;
- import java.io.IOException;
- import java.io.ObjectOutputStream;
- import javax.accessibility.Accessible;
- import javax.accessibility.AccessibleContext;
- import javax.swing.plaf.SeparatorUI;
-
- public class JSeparator extends JComponent implements SwingConstants, Accessible {
- private static final String uiClassID = "SeparatorUI";
- private int orientation;
-
- public JSeparator() {
- this(0);
- }
-
- public JSeparator(int var1) {
- this.orientation = 0;
- this.checkOrientation(var1);
- this.orientation = var1;
- this.updateUI();
- }
-
- private void checkOrientation(int var1) {
- switch (var1) {
- case 0:
- case 1:
- return;
- default:
- throw new IllegalArgumentException("orientation must be one of: VERTICAL, HORIZONTAL");
- }
- }
-
- public AccessibleContext getAccessibleContext() {
- if (super.accessibleContext == null) {
- super.accessibleContext = new AccessibleJSeparator(this);
- }
-
- return super.accessibleContext;
- }
-
- public int getOrientation() {
- return this.orientation;
- }
-
- public SeparatorUI getUI() {
- return (SeparatorUI)super.ui;
- }
-
- public String getUIClassID() {
- return "SeparatorUI";
- }
-
- public boolean isFocusTraversable() {
- return false;
- }
-
- protected String paramString() {
- String var1 = this.orientation == 0 ? "HORIZONTAL" : "VERTICAL";
- return super.paramString() + ",orientation=" + var1;
- }
-
- public void setOrientation(int var1) {
- if (this.orientation != var1) {
- int var2 = this.orientation;
- this.checkOrientation(var1);
- this.orientation = var1;
- ((JComponent)this).firePropertyChange("orientation", var2, var1);
- ((JComponent)this).revalidate();
- ((Component)this).repaint();
- }
- }
-
- public void setUI(SeparatorUI var1) {
- super.setUI(var1);
- }
-
- public void updateUI() {
- this.setUI((SeparatorUI)UIManager.getUI(this));
- }
-
- private void writeObject(ObjectOutputStream var1) throws IOException {
- var1.defaultWriteObject();
- if (super.ui != null && this.getUIClassID().equals("SeparatorUI")) {
- super.ui.installUI(this);
- }
-
- }
- }
-